<?php
/**
 * Created by PhpStorm.
 * User: venki
 * Date: 2023/11/18
 * Time: 17:18
 */

namespace app\behaviors;

use app\events\UserEvent;
use yii\base\Behavior;
use yii\base\Model;

class UserBehavior extends Behavior
{
    public function events(): array
    {
        return [
            UserEvent::USER_SEND_WX   => 'onSendWx',
            UserEvent::USER_SEND_MAIL => 'onSendMail',
        ];
    }

    public function onSendWx($event): void
    {
        echo 'send wx!';
        // 编写主要业务逻辑
    }

    public function onSendMail($event): void
    {
        echo 'send email111';
    }
}